package com.dhj.yygh.controller;

import com.dhj.yygh.common.result.MyResult;
import com.dhj.yygh.service.DepartmentService;
import com.dhj.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "医院科室相关接口")
@RestController
@RequestMapping("/admin/hospital/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("根据医院代码查询相关科室信息")
    @GetMapping("/getDepartmentInfoByHoscode/{hoscode}")
    public MyResult<List<DepartmentVo>> getDepartmentInfoByHoscode(
            @PathVariable("hoscode") String hoscode) {

        List<DepartmentVo> departmentVos = departmentService.getDepartmentInfoByHoscode(hoscode);

        return MyResult.ok(departmentVos);
    }
}
